﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SSharp.Core.DataTypes {
	/// <summary>
	/// Contains a variable of type T. Used like nullable, for types that can already be null.
	/// A variable b of type Box<T> where T can be null can have three states:
	/// A null value
	/// A box containing a null value
	/// A box containing a value
	/// 
	/// A box is immutable.
	/// </summary>
	public class Box<T> {
		public readonly T Value;

		public Box(T value) {
			this.Value = value;
		}
	}

	/// <summary>
	/// Convenience class for Box of object
	/// </summary>
	public class Box : Box<object> {
		public Box(object value) : base(value) { }
	}
}
